package cn.itsource.basic.util;

import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * 工具类：增删改的异步请求结果
 */
@Data
public class AjaxResult {
    private Boolean success = true;
    private String message = "操作成功";
    private Object resultObj;

    public AjaxResult(){}
    public AjaxResult(Boolean success, String message) {
        this.success = success;
        this.message = message;
    }

    //驼峰改造
    public static AjaxResult me(){
        return new AjaxResult();
    }
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return  this;
    }
    public AjaxResult setMessage(String message) {
        this.message = message;
        return  this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return  this;
    }


}
